<%@page import="youleche.com.model.MVehicleImageInfo"%>
<%@page import="java.util.List"%>
<%@page import="youleche.com.controler.controler.AdminPageDataControler"%>
<%@ page language="java" contentType="text/html;charset=UTF-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/WEB-INF/header.jsp" %>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>首页图片管理</title>
<link rel="stylesheet" href="${ctx}/FlexSlider/flexslider.css" media="screen" />
<link href="${ctx}/bootstrap-3.1.1-dist/css/bootstrap.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="${ctx}/js/common/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="${ctx}/FlexSlider/jquery.flexslider-min.js"></script>
<script src="${ctx}/js/jQuery-File-Upload-8.8.5/js/vendor/jquery.ui.widget.js"></script>
<script src="${ctx}/js/jQuery-File-Upload-8.8.5/js/jquery.iframe-transport.js"></script>
<script src="${ctx}/js/jQuery-File-Upload-8.8.5/js/jquery.fileupload.js"></script>
<script src="${ctx}/js/jQuery-File-Upload-8.8.5/js/cors/jquery.xdr-transport.js"></script>
<script type="text/javascript">
$(window).load(function() { 
	$('.flexslider').flexslider({  
		 animation: "slide"
	});
});

$(function(){
	$('#fileupload').fileupload({
		dataType: 'text',
        done: function (e, data) {
           	alert("上传成功");
           	window.location.href = "homeImage.jsp";
        }
	});
});
</script>
</head>
<body>
	<% 
		List<MVehicleImageInfo> list = AdminPageDataControler.getHomeImageInfoForLunBo();
		if(list == null){
			return;
		}
	%>
	<div style="width:800px;margin-left:auto;margin-right:auto;">
		<div style="width:100px;float:left;height:300px;"></div>
		<div style="width:600px;height:350px;float:left;">
			<div class="flexslider">
				<ul class="slides"> 
					<%
						for(MVehicleImageInfo img : list){%>
							<li> <img src="<%=img.getImagePath() %>" /></li>
						<%}
					%>
				</ul>
			</div>
		</div>
		<div style="width:100px;float:left;height:300px;"></div>	
		<div style="width:800px;float:left;height:300px;">
			<div style="width:800px;float:left;height:30px;padding: 5px 5px 5px 5px;background-color:#ddd;">
				更新首页图片
			</div>
			<div style="width:800px;float:left;height:270px;padding: 5px 5px 5px 5px;">
				<input id="fileupload" type="file" name="files[]" data-url="${ctx}/admin/imghome.do" style="width: 300px;height:30px;border:1px solid #ccc;"/>
			</div>
		</div>				
	</div>
</body>
</html>